Repository navigation
feat(agc): capture GPU atomic image inputs before selected dispatches - #3
Draft
p3n1cillin wants to merge 2 commits into
Draft
p3n1cillin wants to merge 2 commits into
p3n1cillin wants to merge 2 commits into
Conversation
7 tasks done
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A selected compute dispatch can stall after earlier GPU writes changed an atomic image, while a CPU-side shader request capture cannot show that input. Add an opt-in, bounded readback immediately before the selected prepared dispatch so its actual atomic image contents can be inspected alongside the final prepared SPIR-V and patched push constants.
APS5_DUMP_ATOMIC_INPUTselects a hexadecimal program address.APS5_DUMP_ATOMIC_INPUT_DIRselects the output directory andAPS5_DUMP_ATOMIC_INPUT_LIMITsets a count from 1 to 64 (default 8). Captures are limited to 16 MiB per image and 64 MiB per session. Packed image data and metadata include format, mip, layers, dimensions, storage element and dispatch variants. When GPU timing is enabled, the log correlates the following dispatch with its exact submission batch and timing range.The capture submits and waits for preceding work, then reads the image through a staging buffer and restores its GENERAL layout. It changes diagnostic timing and is unsuitable for performance comparisons. Default operation performs no capture readbacks. File errors stop capturing; GPU errors still propagate. Metadata is written last as the successful capture marker.
This captures atomic images only. Guest buffers, sampled textures and resolved GPU-indirect argument values are not captured. Normal resource preparation and completion actions can publish earlier GPU results; the capture does not write its copied bytes back to guest memory.
Related investigation: #1. This is diagnostic infrastructure, not a fix for that stall. Outputs can contain proprietary shader data and must remain private. The open upstream gated-dispatch capture PR boykopovar#1864 concerns when guest requests are resolved; it does not implement this GPU atomic image readback.
Tested
Windows 11, GCC 15.2 MinGW, RTX 5070, NVIDIA 617.42:
ctest -R '^agc_driver_gpu_atomic_input$'passed in 0.40 s.Checklist